﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Entity]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Entity](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Description] [nvarchar](250) NULL,
	[TeamID] [int] NOT NULL,
	[Photo] [image] NULL,
	[EntityTypeID] [int] NOT NULL,
	[MaxSendingPause] [int] NULL
 CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT COLUMN_NAME 	FROM INFORMATION_SCHEMA.COLUMNS	WHERE TABLE_NAME = 'Entity' AND COLUMN_NAME = 'MaxSendingPause')
BEGIN
	ALTER TABLE Entity ADD [MaxSendingPause] [int] NULL
END 